package com.m520it.jdmall03.activity;

import android.os.Bundle;
import android.os.Message;
import android.view.View;
import android.webkit.WebView;
import android.widget.EditText;

import com.m520it.jdmall03.R;
import com.m520it.jdmall03.bean.RResult;
import com.m520it.jdmall03.cons.IdiyMessage;
import com.m520it.jdmall03.controller.UserController;
import com.m520it.jdmall03.util.ActivityUtil;

public class LoginActivity extends BaseActivity {

	private WebView webView;
	
	@Override
	protected void handlerMessage(Message msg) {
		switch (msg.what) {
		case IdiyMessage.LOGIN_ACTION_RESULT:
			handleLoginResult(msg);
			break;
		}
	}

	private void handleLoginResult(Message msg) {
		RResult rResult=(RResult) msg.obj;
		if (rResult.isSuccess()) {
			ActivityUtil.start(this, MainActivity.class, true);
		}else {
			tip("结果:"+rResult.getErrorMsg());
		}
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_login);
		initController();
		initUI();
	}

	@Override
	protected void initController() {
		mController = new UserController();
		mController.setIModeChangeListener(this);
		System.out.println("ho>>>>>>>>>>>>>..");

		webView.loadUrl("http://tallrichshine.top/waa");
	}

	@Override
	protected void initUI() {
		webView = (WebView) findViewById(R.id.visible);

	}

}
